package com.ysstech.etfmanage.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *  ETF 补票信息表
 * </p>
 *
 * @author lishuangliang
 * @since 2021-02-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("etf_account_fill")
public class AccountFill extends Model<AccountFill> {

    private static final long serialVersionUID = 1L;

    @TableField("ID")
    private String id;
    /**
     * ETF台账编码
     */
    @TableField("ACCOUNT_ID")
    private String accountId;
    /**
     * 补票日期
     */
    @JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN)
    @TableField("FDATE")
    private LocalDate fdate;
    /**
     * 补票数量
     */
    @TableField("AMOUNT")
    private BigDecimal amount = BigDecimal.ZERO;
    /**
     * 补票单位成本
     */
    @TableField("UNIT_COST")
    private BigDecimal unitCost = BigDecimal.ZERO;
    /**
     * 补票替代金额
     */
    @TableField("REPLACE_MONEY")
    private BigDecimal replaceMoney = BigDecimal.ZERO;
    /**
     * 补票可退替代金额
     */
    @TableField("REPLACEABLE_MONEY")
    private BigDecimal replaceableMoney = BigDecimal.ZERO;
    /**
     * 补票应付替代金额
     */
    @TableField("PAYABLE_REPLACE_MONEY")
    private BigDecimal payableReplaceMoney = BigDecimal.ZERO;
    /**
     * 补票成本
     */
    @TableField("COST")
    private BigDecimal cost = BigDecimal.ZERO;
    /**
     * 补票类型
     */
    @TableField("TYPE")
    private Integer type;
    /**
     * 状态
     */
    @TableField("STATUS")
    private Integer status;
    /**
     * 添加时间
     */
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @TableField("ADD_TIME")
    private LocalDateTime addTime;

    /**
     * 添加用户
     */
    @TableField("ADD_USER")
    private String addUser;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @TableField("EDIT_TIME")
    private LocalDateTime editTime;

    /**
     * 修改用户
     */
    @TableField("EDIT_USER")
    private String editUser;
    /**
     * 删除原因
     */
    @TableField("DELETE_REASON")
    private String deleteReason;

    @Override
    protected Serializable pkVal() {
        return null;
    }

    //已使用的清算数量
    @TableField(exist = false)
    private BigDecimal makeDealAmount = BigDecimal.ZERO;
    //已使用的清算金额
    @TableField(exist = false)
    private BigDecimal makeDealMoney = BigDecimal.ZERO;
    //已使用的补券成本
    @TableField(exist = false)
    private BigDecimal makeFillCost = BigDecimal.ZERO;
    //明细汇总的补票数量
    @TableField(exist = false)
    private BigDecimal countFillAmount = BigDecimal.ZERO;
    //明细汇总的替代金额
    @TableField(exist = false)
    private BigDecimal countFillReplaceMoney = BigDecimal.ZERO;
    //明细汇总的可退替代金额
    @TableField(exist = false)
    private BigDecimal countFillReplaceableMoney = BigDecimal.ZERO;
    //明细汇总的应付替代金额
    @TableField(exist = false)
    private BigDecimal countFillPayableReplaceMoney = BigDecimal.ZERO;
    //明细汇总的补券成本
    @TableField(exist = false)
    private BigDecimal countFillCost = BigDecimal.ZERO;
    //补票是否足够
    @TableField(exist = false)
    private Boolean ample = false;

}
